<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>首页</title>
    <link rel="stylesheet" href="./css/base.css">
</head>
<body>
    <div class="container">
       <div>
            <div>
                <button class="btn-back">返回</button>
            </div>
            <h3>详情页</h3>
            <div class="box">
                地区数字: 
            </div>
       </div>
    </div>

    <script>
        // 1. 获取页面相关的标签
        var btnBack = document.querySelector(".btn-back");
        var box = document.querySelector(".box");
        // 2.0 获取页面的地区ID
        var _areanumber = location.search;
        if(_areanumber.indexOf("?") >-1 ){
            _areanumber = _areanumber.split("=")[1];
            box.innerHTML = "地区数字: "+_areanumber;
        }
        // 3.0 返回上一页
        btnBack.onclick = function(){
             // 调用history的API
            //  history.back();
             history.go(-1);
        }
    </script>
</body>
</html>